package com.jxm.hutools;

import cn.hutool.core.util.StrUtil;
import org.junit.Test;

/**
 * @Author: jxm
 * @Description:
 * @Date: 2023-12-18 15:40
 * @Version: 1.0
 */
public class StrUtilTest {

    //hasBlank、hasEmpty方法
    @Test
    public void test1(){
        //hasBlank、hasEmpty方法
        String str1 = null;
        String str2 = "";
        System.out.println(StrUtil.hasEmpty(str2));

        System.out.println(StrUtil.hasBlank(str2));

    }

    //removePrefix、removeSuffix方法
    @Test
    public void test2(){
        String fileName = StrUtil.removePrefix("pretty_girl.jpg", "pretty_girl");
        System.out.println(fileName);
        String fileName1 = StrUtil.removeSuffix("pretty_girl.jpg.jpg", ".jpg");  //fileName -> pretty_girl
        System.out.println(fileName1);
    }
}
